#pragma once

#include "GameObject.h"
#include "Node.h"
#include "InputHandler.h"

class Player : public GameObject
{
	public:
		Player();
		~Player();

		enum Direction
		{
			North,
			South,
			West,
			East,
			NE,
			SE,
			SW,
			NW
		};

		void Initialize(std::vector<std::vector<Node*>> &pGrid);
		void Cleanup();
		void Update(float pDeltaTime);

		void MoveInDirection(Direction pDir);

		void SetCurrentNode(Node* pNode){ m_xCurrentNode = pNode; }

		sf::Vector2f GetPosition(){ return m_vPosition; }

	private:
		// Grid reference
		std::vector<std::vector<Node*>> Grid;
		
		// Input
		InputHandler* m_xInputHandler;

		// Movement variables
		Node* m_xCurrentNode;
		Node* m_xTargetNode;

		sf::Vector2f m_vTargetPosition;
		float m_fCheckRange;
		bool m_bReachedTarget;

		sf::CircleShape* m_xRange;
};

